#!/bin/bash


DIR=$(dirname $0)

pip3 install -r requirements.txt
echo $(git describe --abbrev=0 2> /dev/null || echo Development) > $HOME/.config/today-cli/.version

if [[ $DIR == *"."* ]]; then
    link=$(echo "$PWD $DIR" | sed 's/ \.//')
else
    link=$(echo $DIR)
fi

rm -rf $HOME/.local/bin/today 2> /dev/null
ln -s "$link/today" $HOME/.local/bin/
